package com.xfzp.d3;

/**
 * 几何运算
 * @author AndroidApe
 * @version 2012-11-5
 */
public class Geometry {

	/**
	 * 点到平面的距离
	 * 
	 * @param p
	 * @param c1
	 * @param c2
	 * @param c3
	 * @return
	 */
	public static double point2Plane(Coord p, Coord c1, Coord c2, Coord c3) {
		Coord f = c1.subtract(c2).cross(c2.subtract(c3));
		return Math.abs(f.dot(p.subtract(c1)) / Math.sqrt(f.dot(f)));
	}
}
